<!DOCTYPE html>
<html lang="cn-zh">

<head>
  
  <meta charset="utf-8">



<meta name="viewport" content="width=device-width, initial-scale=1.0">


  
    <meta name="description" content="使用环境是 macOS13 Qt Creator版本是9.0
错误原因分析：未导入 ssl 和 crypto 相关库
解决方法：在 .pro 文件中加入一下代码
LIBS &#43;= -lssl LIBS &#43;= -lcrypto LIBS &#43;= -L&#34;/opt/homebrew/Cellar/openssl@1.1/1.1.1s/lib&#34; INCLUDEPATH &#43;= /opt/homebrew/Cellar/openssl@1.1/1.1.1s/include 其中openssl的路径依据安装路径不同存在不一致的情况，我自己的openssl是通过 brew install openssl 如果是M系列可能需要使用 arch -arm64 brew install openssl">
  


<meta name="color-scheme" content="light dark">







<meta name="generator" content="Hugo 0.111.2">

<meta content="" name="keywords">
<meta content="Qt开发https请求报 qt.tlsbackend.ossl: Failed to load libssl/libcrypto. - 通通不同-博客" property="og:title">
<meta content="开发的乐趣在于相通而不同 - " property="og:description">

<meta name="msvalidate.01" content="F56ED94B7E86941E3DACEF208F07D329" />

  <title>
    
    Qt开发https请求报 qt.tlsbackend.ossl: Failed to load libssl/libcrypto.
     - 通通不同-博客
    
</title>

  <link rel="canonical" href="https://codebeautiful.gitee.io/post/qt_https_failed_to_load_libssl_libcrypto/">


  








  
    
  
  
  <link rel="stylesheet" href="/css/base.min.4f231885947d13c748c815d93da49f07ab89afb67629f9970b7c054610e88e0b.css" integrity="sha256-TyMYhZR9E8dIyBXZPaSfB6uJr7Z2KfmXC3wFRhDojgs=" crossorigin="anonymous">



</head>

<body>
  <nav class="u-background">
  <div class="u-wrapper">
    <ul class="Banner">
      <li class="Banner-item Banner-item--title">
        <h1 class="Banner-heading">
          <a class="Banner-link u-clickable" href="/">通通不同-博客</a>
        </h1>
      </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/post/">全部</a>
        </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/categories/">分类</a>
        </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/tags/">标签</a>
        </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/about/">关于</a>
        </li>
      
    </ul>
  </div>
</nav>

  <main>
    <div class="u-wrapper">
      <div class="u-padding">
        

  <article>
    <header class="Heading">
  <h2 class="Heading-title">
    <a class="Heading-link u-clickable" href="/post/qt_https_failed_to_load_libssl_libcrypto/" rel="bookmark">Qt开发https请求报 qt.tlsbackend.ossl: Failed to load libssl/libcrypto.</a>
  </h2>
  
    <time datetime="2023-05-06T09:36:26&#43;08:00">6 May, 2023</time>
  
</header>

    <p>使用环境是 macOS13  Qt Creator版本是9.0</p>
<p>错误原因分析：未导入 ssl 和 crypto 相关库</p>
<p>解决方法：在 .pro 文件中加入一下代码</p>

<pre tabindex="0"><code>LIBS += -lssl
LIBS += -lcrypto

LIBS    += -L&#34;/opt/homebrew/Cellar/openssl@1.1/1.1.1s/lib&#34;
INCLUDEPATH += /opt/homebrew/Cellar/openssl@1.1/1.1.1s/include</code></pre>
<p>其中openssl的路径依据安装路径不同存在不一致的情况，我自己的openssl是通过  brew install openssl  如果是M系列可能需要使用  arch -arm64 brew install openssl</p>

    


  

  

  





  <footer>
    
      
    
      
    
      
        <ul class="Tags">
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/qt/" rel="tag">Qt</a>
            </li>
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/ssl/" rel="tag">ssl</a>
            </li>
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/https/" rel="tag">https</a>
            </li>
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/crypto/" rel="tag">crypto</a>
            </li>
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/brew/" rel="tag">brew</a>
            </li>
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/openssl/" rel="tag">openssl</a>
            </li>
          
        </ul>
      
    
  </footer>

    
  

  </article>


      </div>
    </div>
  </main>
  
  <footer class="Footer">
    <div class="u-wrapper">
      <div class="u-padding">
        开发的乐趣在于相通而不同
      </div>
    </div>
  </footer>


  <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?d08a2ad355cb7a065a41be081b43297e";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>

</body>

</html>
